﻿@model Inmeta.VSGallery.Web.Models.ExtensionViewModel

@{
    ViewBag.Title = "Extension";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<head>
    <title>@ViewBag.Title</title>
    <script src='~/Content/jquery.js' type="text/javascript"></script>
    <script src='~/Content/jquery.MetaData.js' type="text/javascript" language="javascript"></script>
    <script src='~/Content/jquery.rating.js' type="text/javascript" language="javascript"></script>
    <link href='~/Content/jquery.rating.css' type="text/css" rel="stylesheet" />
</head>

<h2>Inmeta Visual Studio Extension Gallery</h2>

<div>
    <h4>@Model.Extension.Name</h4>
    <hr />

    @using (Html.BeginForm(MVC.Extension.ActionNames.Post, MVC.Extension.Name, FormMethod.Post, new{id="extensionForm"}))
{
    <input type="hidden" id="VsixId" name="VsixId" value="@Model.Extension.VsixId" />

    <dl class="dl-horizontal">
        <dt></dt>
        <dd><a href="~/api/Download?vsixid=@Model.Extension.VsixId">Download</a><p/><p/></dd>

        <dt>Rate this extension</dt>
        <dd>@Html.EditorFor(m => m.StarRating)</dd>
        <dt>
            @Html.DisplayNameFor(model => model.Extension.VsixVersion)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Extension.VsixVersion)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Extension.Tool)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Extension.Tool)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Extension.Author)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Extension.Author)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.ProjectDescription)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.ProjectDescription)
        </dd>
        <dt>
            <br/>
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Extension.Description)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.Extension.PreviewImage)
        </dt>

        <dd>
            <img class="previewimage" src="~/api/previewimage?vsixid=@Model.Extension.VsixId" />
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Extension.Icon)
        </dt>

        <dd>
            <img class="thumbnail" src="~/api/icon?vsixid=@Model.Extension.VsixId" />
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Extension.MoreInfo)
        </dt>

        <dd>
        @{
            if (!String.IsNullOrEmpty(Model.Extension.MoreInfo))
            {
                <a href="@Model.Extension.MoreInfo" title="More information">@Model.Extension.MoreInfo</a>
            }
        }

        <dt>
            @Html.DisplayNameFor(model => model.Extension.ManifestVersion)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Extension.ManifestVersion)
        </dd>

    </dl>
    <input value="Update" type="submit" name="action:Update" />
    <input type="button" title="Cancel" value="Cancel" onclick="location.href='@Url.Action(MVC.Home.ActionNames.Index, MVC.Home.Name)'" />            <input value="Delete" type="submit" name="action:Delete" onclick="return confirm('Are you sure?')" />
}
    </div>
    <p>


    </p>
